const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
Page({
  data: {
    lists:[],
    isloading:true,
  },
  onShow: function (options) {
    this.lists()
  },
  lists(source){
    console.log(11)
    Controller.LikeFollowList().then(res=>{
      if(res.data.baseData && res.data.baseData.list.length>0){
        this.setData({
          lists:res.data.baseData.list,
        })
      }
      this.setData({
        isloading:false
      })
    })
  },
  cancel(e){
    var data={}
    data.actionId=e.currentTarget.dataset.id;
    Controller.delAction(data).then(res=>{
      this.setData({
        lists:[],
      })
      this.lists()
      wx.showToast({
        title:"取消成功"
      })

    })

  },
  golink(e){
    var item=e.currentTarget.dataset.item;
    wx.navigateTo({
      url:"/pages/expert/expert?id="+item.authorId
    });
    
  },
  onShareAppMessage: function (e) {
    let title = '';
    let imageUrl = '';
    let path=app.getCurrentPageUrlWithArgs()
    let obj = {
      title,
      imageUrl,
      path,
      success: function (res) {},
      fail(err) {}
    }
    return obj
  },
  onShareTimeline: function(res){
    let title = '';
    let imageUrl = '';
    let path=app.getCurrentPageUrlWithArgs()
    let obj = {
      title,
      imageUrl,
      path,
      success: function (res) {},
      fail(err) {}
    }
    return obj
  },
})